<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script src="../js/jquery.js"></script>
    <style type="text/css" rel="stylesheet">
        img{
            width: 200px;
            height: 200px;
        }

    </style>
</head>
<body>
<div>
    <div class="nav"></div>
    <div class="panner"></div>
    <div class="product"></div>
</div>

<script>
    $(function () {
        $.ajax({
            url:"/selectPanner",
            success:function (result) {
                console.log(result);
                if(result.msgCode=="000000"){
                    var map=result.data;
                    var pannersList=map.pannersList;
                    for(var i in pannersList){
                        $('.panner').append("<img src="+pannersList[i].pannerUrl+">"+"</img>");
                    }
                }
            }
        })

     //一级和二级分类
        var classfyId;
        var str="";
        //查询一级和二级分类
        $.ajax({
            url:"/selectProductYJAndRjClassfy",
            success:function (result) {
                console.log(result);
                var  map=result.data;
                var yjClassfy=map.yjclassifyList;
                var rjClassfy=map.rjClassfyList;
                if(result.msgCode=="000000"){
                    for(var i in yjClassfy){
                        classfyId=yjClassfy.classId;
                        // str="/selectProductRjClassfy?classfyId="+classfyId;
                        // $('#yjnav').append("<li class='pro-nav'>"+'<a href="'+str+'">'+classfy[i].classifyName+'</a>'+"</li>");
                        $('.nav').append("<li class='pro-nav'>"+'<a href="'+str+'">'+yjClassfy[i].classifyName+'</a>'+"</li>");
                    }

                    // for(var j in rjClassfy){
                    //     var rjClassId=rjClassfy[j].classId;
                    //     console.log(rjClassId);
                    //     var str="/selectProductSjClassfy?rjClassId="+rjClassId;
                    //     $('.clearfloat').append("<a href="+str+">"+rjClassfy[j].classifyName+"</a>");
                    // }
                }
            }
        })



    })




</script>
</body>
</html>